var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var ccp_menu = cc__decorator.menu;
var def_ComWobble = /* */function (_cc$Component10) {
  function _ctor() {
    var _this17;
    babel_classCallCheck(this, _ctor);
    _this17 = _callSuper(this, _ctor, arguments);
    _this17.wobbleSpeed = .5;
    _this17.wobbleAngle = 20;
    return _this17;
  }
  babel_inherits(_ctor, _cc$Component10);
  return babel_createClass(_ctor, [{
    key: "onEnable",
    value: function onEnable() {
      this.activateWobble();
    }
  }, {
    key: "activateWobble",
    value: function activateWobble() {
      cc.tween(this.node).to(this.wobbleSpeed, {
        angle: this.wobbleAngle
      }).to(this.wobbleSpeed, {
        angle: -this.wobbleAngle
      }).union().repeatForever().start();
    }
  }, {
    key: "startWobble",
    value: function startWobble() {
      this.node && cc.tween(this.node).to(this.wobbleSpeed, {
        angle: this.wobbleAngle
      }).to(this.wobbleSpeed, {
        angle: -this.wobbleAngle
      }).union().repeatForever().start();
    }
  }, {
    key: "stopWobble",
    value: function stopWobble() {
      this.node && cc.tween(this.node).stop();
    }
  }]);
}(cc.Component);
cc__decorate([ccp_property({
  tooltip: "速度"
})], def_ComWobble.prototype, "wobbleSpeed", undefined);
cc__decorate([ccp_property({
  tooltip: "角度"
})], def_ComWobble.prototype, "wobbleAngle", undefined);
def_ComWobble = cc__decorate([ccp_ccclass, ccp_menu("v-lez/ComWobble")], def_ComWobble);
exports.default = def_ComWobble;